//
//  WWRequestAPI.h
//  WangLottery
//
//  Created by 黄修勇 on 12-9-10.
//
//

#import <Foundation/Foundation.h>
#import "WWRequestService.h"
#import "WWDataParser.h"


#define kRequestURL         @"http://27.54.248.115/lottery0/mobie/"
#define kTimeOut            15


@protocol WWRequestResultDelegate <NSObject>

@optional

-(void)requesResult:(NSDictionary *)dic;

@end

@class WWDataParser;

@interface WWRequestAPI : NSObject<ASIHTTPRequestDelegate>{

    @private
    long requestTag;// 流水号 每一次请求 变量自增 
    NSMutableArray *requestArray;
    WWRequestService *requestService;
    WWDataParser *parser;
}

+(WWRequestAPI *)currentRequestAPI;

-(long)requestWithAction:(NSString *)action paras:(NSDictionary *)dic target:(id)target parserSEL:(SEL)sel;

-(BOOL)cancelRequestWithTag:(long)tag;
@end


@interface WWRequest : NSObject

@property (nonatomic)long tag;
@property (nonatomic,assign)ASIHTTPRequest *request;
@property (nonatomic,assign)id target;
@property (nonatomic,retain)NSString *action;
@property (nonatomic)SEL parserSEL;

@end